﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace MsExchangeBcsConnector.ExchangeBdcModel
{
    /// <summary>
    /// This class contains the properties for Entity1. The properties keep the data for Entity1.
    /// If you want to rename the class, don't forget to rename the entity in the model xml as well.
    /// </summary>
    public partial class MailBox : SecureEntity
    {        
        
        private string _Url = string.Empty;
        public string Url {
            get
            {
                return "http://fastdemo/_bdc/MsExchangeBcsConnector/MailBox_1.aspx?EMail=" + EMail;
            }
            set
            {
                this._Url = value;
            }
        }

       // public string OwnerAccount { get; set; }

        internal const char LoginSeparator = ';';
        public virtual string Login { get; set; }

        public void AddLogin(string LoginToAppend)
        {
            if (string.IsNullOrEmpty(this.Login))
            {
                this.Login = LoginToAppend;
            }
            else if (!this.Login.Contains(LoginToAppend))
            {
                this.Login = this.Login + LoginSeparator + LoginToAppend;
            }
            //return this.Login;
        }


        public DateTime LastModifiedTime{get;set;}
        public long DeletedCount { get; set; }

        #region Constructors

        public MailBox() {
            this.LastModifiedTime = DateTime.Now;
            this.DeletedCount = 0;
        }

        /// <summary>
        /// Constructor with identity parameter
        /// </summary>
        /// <param name="EMail"></param>
        public MailBox(string EMail) : this()
        {
            this.EMail = EMail;
        }

        #endregion

 
    }
}
